package com.oromwin.repos.common;

import com.oromwin.repos.common.helper.DBHelper;

public class Query {
    StringBuilder sb = null;
    public Query(String str) {
        sb = new StringBuilder(str);
    }
    public void append(String str) {
        sb.append(str);
    }
    public void delete(int last) {
        int end = sb.length();
        int start = end - last;
        sb.delete(start, end);
    }
    private String escape(String str) {
        if (DBHelper.isOracle) {
            str = str.replaceAll("`", "");
            str = str.replaceAll(";", "");
        }
        return str; //.replace("\\", "\\\\");
    }
    public String toString() {
        return escape(sb.toString());
    }
}
